home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 June
/
Macworld (1999-06).dmg
/
Shareware World
/
Info
/
For Developers
/
MacZoop2.0.sea
/
MacZoop2.0
/
Required Classes
/
ZErrors.cpp
< prev
next >
Wrap
Text File
|
1998-10-29
|
1KB
|
99 lines
/*************************************************************************************************
*
*
* MacZoop - "the framework for the rest of us"
*
*
*
* ZErrors.cpp -- utils for throwing exceptions
*
*
*
*
*
* © 1996, Graham Cox
*
*
*
*
*************************************************************************************************/
#include "ZErrors.h"
#include "ZDefines.h"
void FailNIL( void* aPtr )
{
if ( aPtr == NULL )
throw (OSErr) memFullErr;
}
void FailOSErr( OSErr theErr )
{
if ( theErr != noErr )
throw theErr;
}
void FailMemError()
{
FailOSErr( MemError());
}
void FailResError()
{
FailOSErr( ResError());
}
void Fail()
{
FailOSErr( kUnknownExceptionErr );
}
void FailNILRes( void* aResPtr )
{
if ( aResPtr == NULL )
FailOSErr( resNotFound );
}
void FailSilent()
{
FailOSErr( kSilentErr );
}
void FailParamErr( OSErr theErr )
{
if ( theErr != noErr )
FailOSErr( kMacZoopParamErr1 );
}
void FailNILParam( void* aPtr )
{
if ( aPtr == NULL )
FailOSErr( kMacZoopParamErr );
}
void FailNILErr( void* aPtr, OSErr err )
{
if ( aPtr == NULL )
{
if ( err == noErr )
throw kUnknownExceptionErr;
else
throw err;
}
}